﻿@model Century.Common.Structures.CenturyAdminToken
<center>
    <br />
    <br />
    <br />
    <br />
    <h1>
        @ViewBag.Message
    </h1>
    <br />
    <img src="@Url.Content("~/Content/themes/admin/img/general/world-map.jpg")" alt="Admin Area" />
    @if (Century.Web.Security.Authorizations.CenturyAuthorization.Authorize(HttpContext.Current.User.Identity.Name, new Century.Web.Security.ActionModule { Name = "Administration", DisplayName = "Administration" }))
    {
        <br />
        <a onclick="reload('');" style="cursor:pointer;">
            <img src="@Url.Content("~/Content/themes/admin/img/general/refresh.png")" alt="Refresh" />
            Refresh All
        </a>
        <br />
        foreach (Century.Models.Common.CountrySite site in Century.Business.Repository.PersistData.AvailableSites)
        {
            <span>
                &nbsp;
                <a onclick="reload('@(site.Path)');" style="cursor:pointer;">
                    <img src="@Url.Content("~/Content/themes/admin/img/general/refresh.png")" alt="Refresh" />
                    @(site.Name + " " + site.Path)
                </a>
                &nbsp;
            </span>
        }
        <script type="text/javascript" language="javascript">
            function reload(sitepath) {
                $.post('@(Url.Action("Reload", "AdminArea"))' + '/' + sitepath, function (data) {
                    alert('Clear operation successfully has completed.');
                });
            }
        </script>
    }
</center>
